#!/usr/bin/perl -w
print "Content-type:text/html\n";

$username = $ARGV[0];
$pass     = $ARGV[1];
$pass =~ s/\+/\\+/g;
$pass =~ s/\(/\\(/g;
$pass =~ s/\)/\\)/g;
$pass =~ s/\[/\\]/g;


$pass =~ s/\]/\\]/g;
#$pass =~ s/\\/\\\/g;
$pass =~ s/\{/\\{/g;



$pass =~ s/\}/\\}/g;
$pass =~ s/\^/\\^/g;



$pass =~ s/\*/\\*/g;
$pass =~ s/\?/\\?/g;
$pass =~ s/\./\\./g;

open (info, "../admin/users/users.txt") or die "Died";	# Open the file
while (<info>)   # Read a line
{	
			# not a comment neither a white line neither white space character

			if (/(\s*$username\s*)\|

				 (\s*$pass\s*)\|

				  (\w+\s*\w+)+\|

		\s*(\d{4}-\d{1,2}-\d{1,2})?\s*\|

				  (\s*\w+\s*)?\|

		      (\s*\w+\s*(,\s*\w+\s*)*)\#

			(\s*[\x20-\x7E]*\s*\n)/x)

			{
				print $6;
				
				exit(9);
			}
			else
			{
				#print "Not Working\n";
			}
	
}
close(INFO);			# Close the file




